#ifndef DEFINES_H
#define DEFINES_H

enum WidgetType{ W3C_WIDGET = 0, APPLE_WIDGET, GOOGLE_WIDGET, YAHOO_WIDGET, OPERA_WIDGET, WRT_WIDGET, DIRECTORY, UNKNOWN_WIDGET };

// TODO get rid of this enum here, try getting rid of even in the iqtprojectgenerator interface
//      rationale: these phases are too much symbian specific
// OBS FDOS enum GeneratorPhase{ INITIAL, UNZIP_WIDGET, QMAKE_PLUGINS, MAKE_PLUGINS, QMAKE_FW, MAKE_FW, MAKESIS_FW, QMAKE_APP, MAKE_APP, MAKESIS_APP, ENDED_SUCCESSFULLY, ENDED_WITH_ERRORS,  };

/**
  * Phases of project generation vary from platform to platform, even
  * in their numbers. Therefore this is just a generic placeholder for an
  * intvalue that will happen to be the same as a platform specific enum value.
  *
  * The reason this is not merely an int or even a typedef to an int is
  * that this way compiler will enforce that this is a different type (although
  * opaque from the application point of view).
  */
struct GeneratorPhase
{
    int m_phase;

    GeneratorPhase(int phase);
    GeneratorPhase();
};


bool operator==(const GeneratorPhase & left,
                const GeneratorPhase & right);


bool operator!=(const GeneratorPhase & left,
                const GeneratorPhase & right);



enum GeneratorTarget { NO_TARGET, PREVIEW, BUILD, REBUILD };
//enum SymbianCapabilities{ LOCALSERVICES, LOCATION, NETWORKSERVICES, READUSERDATA, USERENVIRONMENT, WRITEUSERDATA, POWERMGMT, PROTSERV, READDEVICEDATA, SORROUNDINGSDD, SWEVENT, TRUSTEDUI, WRITEDEVICEDATA, COMMDD, DISKADMIN, NETWORKCONTROL, MULTIMEDIADD, ALLFILES, DRM, TCB };

#define GENERATOR_QT_VERSION "4.6.2"

#define HAG_TEMP_DIR "/__hag_temp_dir"
#define BUILD_DIR "/hag_build/"

#define FRAMEWORK_DIR "/fw/"
#define PLUGINSTUBS_DIR "/qmakepluginstubs/"
#define TEMPLATES_DIR "/templates/hybrid/"
#define PLUGINS_DIR "/mw/"
#define WIDGET_SUBDIR "widget/"

#define PLUGINS_PROJECT_FILE "mw.pro"
#define FRAMEWORK_PROJECT_FILE "fw.pro"
#define PROJECT_TEMPLATE_FILE "hybridapp.pro"
#define HYBRIDAPI_JS_FILE "hybridapi.js"
#define DISABLE_SELECTION_CSS_FILE "disable-selection.css"
#define INFO_PLIST_FILE "info.plist"
#define ICON_FILE "icon.png"
#define MAIN_FILE "main.cpp"
#define MAIN_WINDOW_FILE "mainwindow.cpp"
#define WIDGET_IDENTIFIER_FILE "coremethods.cpp"
#define GENERATOR_LOG_FILE "hag.log"

#define W3C_CONFIG_FILE "config.xml"
#define W3C_MAIN_HTML_FILE "index.html"
#define W3C_ROOT_TAG "widget"
#define WRT_WIDGET_FILE_EXTENSION "wgz"

#define QMAKE_APP_NAME "qmake"
#define MAKE_APP_NAME "make"
#define MAKESIS_APP_NAME "makesis"
#define UNZIP_APP_NAME "unzip"

#define INFO_PLIST_TAG_KEY "key"
#define INFO_PLIST_TAG_DICT "dict"
#define QRC_FILE_TAG_RCC "RCC"
#define QRC_FILE_TAG_QRESOURCE "qresource"
#define QRC_FILE_ATTRIBUTE_PREFIX "prefix"
#define QRC_FILE_TAG_FILE "file"

#define CONFIG_XML_WIDGET_TAG "widget"

// key values in info.plist file
#define INFO_PLIST_KEY_DISPLAY_NAME "DisplayName"
#define INFO_PLIST_KEY_IDENTIFIER "Identifier"
#define INFO_PLIST_KEY_MAIN_HTML "MainHTML"
#define INFO_PLIST_KEY_ALLOW_NETWORK_ACCESS "AllowNetworkAccess"
#define INFO_PLIST_KEY_VERSION "Version"
#define INFO_PLIST_KEY_MINI_VIEW_ENABLED "MiniViewEnabled"
#define INFO_PLIST_KEY_UID "UID"

#define KEY_WIDGET_ROOT_DIR "WidgetRootDir"
#define KEY_WIDGET_ICON_FILE "WidgetIconFile"

// tags to be replaced in template files
#define MAIN_HTML_FILE_TAG "@main_html_file"
#define TOOL_NAME_TAG "@tool_name"
#define TIMSTAMP_TAG "@timestamp"
#define APPLICATION_NAME_TAG "@application_name"
#define RESOURCE_FILE_TAG "@resource_file"
#define WIDGET_IDENTIFIER_TAG "@widget_identifier"
#define SYMBIAN_UID3_TAG "@uid3"
#define PANNING_ENABLED_TAG "@panning_enabled"
#define FULL_SCREEN_TAG "@full_screen_enabled"
#define SOFT_KEYS_TAG "@soft_keys_enabled"

#define INFO_PLIST_DISPLAY_NAME_TAG "@DisplayName"
#define INFO_PLIST_IDENTIFIER_TAG "@Identifier"
#define INFO_PLIST_MAIN_HTML_TAG "@MainHTML"
#define INFO_PLIST_VERSION_TAG "@Version"
#define MOBILITY_PATH_TAG "@qt_mobility_path"
#define SDK_VERSION_DEFINES_TAG "@sdk_version_defines"
#define PLUGIN_DEPLOYMENT_TAG "@hybrid_plugin_deployment"

#define TOOL_NAME_STRING "Qt Project Generator"

#define PLUGINS_PROJECT_FILE_CONTENT "TEMPLATE = subdirs\nCONFIG += ordered\nSUBDIRS = %1"

#define MSG_PROCESS_EXIT_CODE_STATUS "existCode: %1, exitStatus: %2"
#define MSG_FILE_PROCESSING_COMPLETED "%1 file processing completed"
#define MSG_FILE_UPDATED_SUCCESSFULLY "%1 file updated successfully"
#define MSG_FILE_CREATED_SUCCESSFULLY "%1 file created successfully"
#define MSG_WIDGET_DIRECTORY_PROCESSED_N_FILES_FOUND "Widget directory processed: %1 files found"
#define MSG_WIDGET_FILES_COPIED_TO_DIRECTORY "Widget files copied to %1"

#define ERR_FILE_NOT_SELECTED "File not selected! Cannot continue!"
#define ERR_FILE_NOT_FOUND "%1 not found! Cannot continue!"
#define ERR_FILE_NOT_FOUND_CAN_CONTINUE "%1 not found!"
#define ERR_FILE_OPEN_READ_FAILED_CANNOT_CONTINUE "Failed to open %1 file for reading! Cannot continue!"
#define ERR_FILE_OPEN_WRITE_FAILED_CANNOT_CONTINUE "Failed to open %1 file for writing! Cannot continue!"
#define ERR_FILE_OPEN_WRITE_FAILED_CAN_CONTINUE "Failed to open %1 file for writing!"
#define ERR_PROCESS_FINISHED_WITH_ERRORS_CANNOT_CONTINUE "%1 finished with errors, cannot continue: "
#define ERR_FILE_COPY_FAILED "Failed to copy file %1 to %2!"
#define ERR_FILE_OPEN_FAILED_TITLE "File open failed"
#define ERR_TITLE "Error"
#define ERR_WIDGET_TAG_NOT_FOUND_CANNOT_CONTINUE "widget-tag not found in config.xml file! Cannot continue!"
#define ERR_CANNOT_FIND_UID3_IN_MMP_FILE "UID not found in %1 file, cannot embed hybridfw sis in application sis"

#define ERR_FILE_PARSING_FAILED_CANNOT_CONTINUE "Failed to parse %1 file! Cannot continue!"
#define ERR_XML_NODE_NOT_FOUND "%1 node not found in %2, file can not be processed!"

#define HAG_STATUS_EXTRACTING_WIDGET "Extracting widget files";
#define HAG_STATUS_BUILDING_APP "Building hybrid application";
#define HAG_STATUS_BUILDING_PLUGINS "Building plugins";
#define HAG_STATUS_IDLE "Idle";
#define HAG_STATUS_COMPLETED_OK "Compilation completed successfully";
#define HAG_STATUS_COMPLETED_NOTOK "Compilation failed. See hag.log file for details.";

#endif // DEFINES_H
